package top.revery.api.api.payWallet;

import org.springframework.web.bind.annotation.*;

import top.revery.api.config.PayType;
import top.revery.api.config.UserPageData;
import top.revery.api.entity.payWallet.BaseAliayBD;
import top.revery.api.entity.payWallet.BaseLogUser;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.Map;

/**
 * @author denghao
 * @title   记录用户钱包资金明细
 * @package
 * @date 2019/12/16 14:26
 */
@RequestMapping("/api_logUser")
public interface ILogUserApi {

    //分页多条件查询所有
    @PostMapping("/getList")
    UserPageData getList(@RequestParam(value = "pageNum") int pageNum, @RequestParam(value = "pageSize")int pageSize,
                         @RequestBody Map map);

    //保存用户资金明细
    @PostMapping("/save")
    BaseLogUser save(@RequestBody BaseLogUser baseLogUser);

    //根据id查询
    @PostMapping("/findById")
    BaseLogUser findById(@RequestParam("id") Long id);

    //用户充值
    @GetMapping("/rechargeMoney")
    public String rechargeMoney(@RequestParam("money") BigDecimal money, @RequestBody PayType payType)throws Exception;

    //支付回调
    @PostMapping("/notify")
    String alipayNotify(HttpServletRequest request,@RequestParam("id")Long id)throws Exception;

    //用户提现
    @PostMapping("/drawMoney")
    public BaseAliayBD drawMoney(@RequestParam("money") BigDecimal money, @RequestParam("account")String account,
                                     @RequestParam("userName")String userName, @RequestParam("id")Long id)throws Exception;
   //根据userId查询提现
    @PostMapping("/getById")
    BaseAliayBD getById(@RequestParam("id") Long id)throws Exception;

    //转账
    @PostMapping("/transfer")
    public Map<String,String> transfer(@RequestBody BaseAliayBD baseAliayBD)throws Exception;


    //微信支付回调
    @PostMapping("/wxnotify")
    String wxNotify(HttpServletRequest request,@RequestParam("id")Long id)throws Exception;
}
